<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例4</title>
</head>
<style>
    span{
        color: red;
    }
</style>
<body>
    <input type="text" id="t1"> VS <input type="text" id="t2"> <input type="button" id="btn" value="最大的数是>>"> <span id="t3">?</span>
</body>
<script>
    //179001236 王兴
    var t1=document.getElementById("t1")
    var t2=document.getElementById("t2")
    var t3=document.getElementById("t3")
    var btn=document.getElementById("btn")
    btn.onclick=function(){
        if(parseInt(t1.value)>parseInt(t2.value)){
            t3.innerText=parseInt(t1.value)
        }
        else{
            t3.innerText=parseInt(t2.value)
        }
    }
</script>
</html>

